
function orderService($http) {
    
        function findOrderInfoByCustomerId(customerId, callback) {
            $http.get("o2o/customer/findOrderInfoByCustomerId/" + customerId)
                .then(function (res) {
                    console.log('====' + res.data);
                    callback(null, res.data);
                })
                .catch(function (err) {
                    console.log(err);
                    callback(err, null);
                });
        }
    
        function updateOrderStatus(order, callback) {
            var postData = {
                "_id": order._id,
                "status": order.status,
            };
            var config = {
    
            };
            $http.post("/o2o/customer/updateorderInfo", postData, config)
                .then(function (res) {
                    console.log(res);
                    callback(null, res.data);
                })
                .catch(function (err) {
                    console.error(err);
                    callback(err, null);
                });
        }
    
    
    
    
        return {
            findOrderInfoByCustomerId: findOrderInfoByCustomerId,
            updateOrderStatus: updateOrderStatus
        }
    
    
    
    
    }
    
    module.exports = orderService;